import 'package:flutter/cupertino.dart';
import 'package:meal/constant/fonts.dart';
import 'package:meal/constant/sizes.dart';
import 'package:meal/utils/colors.dart';
import 'package:meal/utils/styles.dart';

class FreeActivity extends StatefulWidget {
  const FreeActivity({Key? key}) : super(key: key);

  @override
  State<FreeActivity> createState() => _FreeActivityState();
}

class _FreeActivityState extends State<FreeActivity> {
  TextStyle get defaultStyle {
    return StylesUtils.customTextStyle(color: ColorsUtils.color333, lineHeight: 1.8);
  }

  TextStyle get style {
    return StylesUtils.customTextStyle(color: ColorsUtils.color797);
  }

  @override
  Widget build(BuildContext context) {
    return Column(
      children: [
        Container(
          padding: const EdgeInsets.symmetric(vertical: Sizes.default20),
          child: Text(
            '满500P减50P',
            style: StylesUtils.customTextStyle(
                color: ColorsUtils.color333, fontSize: Sizes.default16, fontWeight: Fonts.w7),
          ),
        ),
        Container(
          margin: const EdgeInsets.only(bottom: Sizes.default20),
          padding: const EdgeInsets.symmetric(horizontal: Sizes.default15),
          child: Row(
            crossAxisAlignment: CrossAxisAlignment.start,
            children: [
              Expanded(
                flex: 1,
                child: Container(
                  alignment: Alignment.centerLeft,
                  child: Text(
                    '活动细则',
                    style: defaultStyle,
                  ),
                ),
              ),
              Expanded(
                flex: 5,
                child: Container(
                  alignment: Alignment.centerLeft,
                  child: Text(
                    '满500P减50P（减免部分，平台承担10P，商家承担40P）',
                    style: style,
                  ),
                ),
              )
            ],
          ),
        ),
        Container(
          margin: const EdgeInsets.only(bottom: Sizes.default20),
          padding: const EdgeInsets.symmetric(horizontal: Sizes.default15),
          child: Row(
            crossAxisAlignment: CrossAxisAlignment.start,
            children: [
              Expanded(
                flex: 1,
                child: Container(
                  alignment: Alignment.centerLeft,
                  child: Text(
                    '用户类型',
                    style: defaultStyle,
                  ),
                ),
              ),
              Expanded(
                flex: 5,
                child: Container(
                  alignment: Alignment.centerLeft,
                  child: Text(
                    '所有用户',
                    style: style,
                  ),
                ),
              )
            ],
          ),
        ),
        Container(
          margin: const EdgeInsets.only(bottom: Sizes.default20),
          padding: const EdgeInsets.symmetric(horizontal: Sizes.default15),
          child: Row(
            crossAxisAlignment: CrossAxisAlignment.start,
            children: [
              Expanded(
                flex: 1,
                child: Container(
                  alignment: Alignment.centerLeft,
                  child: Text(
                    '使用方式',
                    style: defaultStyle,
                  ),
                ),
              ),
              Expanded(
                flex: 5,
                child: Container(
                  alignment: Alignment.centerLeft,
                  child: Text(
                    '移动端',
                    style: style,
                  ),
                ),
              )
            ],
          ),
        ),
        Container(
          margin: const EdgeInsets.only(bottom: Sizes.default20),
          padding: const EdgeInsets.symmetric(horizontal: Sizes.default15),
          child: Row(
            crossAxisAlignment: CrossAxisAlignment.start,
            children: [
              Expanded(
                flex: 1,
                child: Container(
                  alignment: Alignment.centerLeft,
                  child: Text(
                    '活动日期',
                    style: defaultStyle,
                  ),
                ),
              ),
              Expanded(
                flex: 5,
                child: Container(
                  alignment: Alignment.centerLeft,
                  child: Text(
                    '2023-03-15 至 2023-12-17',
                    style: style,
                  ),
                ),
              )
            ],
          ),
        ),
        Container(
          margin: const EdgeInsets.only(bottom: Sizes.default20),
          padding: const EdgeInsets.symmetric(horizontal: Sizes.default15),
          child: Row(
            crossAxisAlignment: CrossAxisAlignment.start,
            children: [
              Expanded(
                flex: 1,
                child: Container(
                  alignment: Alignment.centerLeft,
                  child: Text(
                    '报名日期',
                    style: defaultStyle,
                  ),
                ),
              ),
              Expanded(
                flex: 5,
                child: Container(
                  alignment: Alignment.centerLeft,
                  child: Text(
                    '2023-02-12 至 2023-09-12',
                    style: style,
                  ),
                ),
              )
            ],
          ),
        ),
      ],
    );
  }
}
